/**
 * @Project Name: ${projectName}
 * @Package Name: ${projectPackageName}.business.client.${domainName}
 * @Since JDK 1.8
 */
package ${projectPackageName}.business.client.${domainName};

import ${projectPackageName}.business.constant.${domainName}.${className}ServiceConstants;
import ${projectPackageName}.business.constant.common.CommonServiceConstants;
import ${projectPackageName}.business.domain.dto.${domainName}.${className}DTO;
import ${projectPackageName}.business.fallback.${domainName}.${className}FeignClientFallbackFactory;
import ${projectPackageName}.commons.tools.page.ConditionAndPagination;
import ${projectPackageName}.commons.tools.page.PageData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: ${className}FeignClient
 * @Author 胡松 hoofungson@163.com
 * @Date ${datetime}
 * @Version V1.0
 */
 @FeignClient(value = "swxl-business-server", fallbackFactory = ${className}FeignClientFallbackFactory.class)
public interface ${className}FeignClient {

    /**
     * 保存或更新
     *
     * @param ${lowerCaseClassName}DTO
     * @return
     **/
    @PostMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX)
    Boolean saveOrUpdate(@RequestBody ${className}DTO ${lowerCaseClassName}DTO);

    /**
     * 批量保存或更新
     *
     * @param ${lowerCaseClassName}DTOList
     * @return
     **/
    @PostMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/batch/save-or-update")
    Boolean batchSaveOrUpdate(@RequestBody List<${className}DTO> ${lowerCaseClassName}DTOList);

    /**
     * 根据ID获取
     *
     * @param id
     * @return
     **/
    @GetMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/{id}")
    ${className}DTO getById(@PathVariable("id") Long id);

    /**
     * 根据条件获取
     *
     * @param condition
     * @return
     **/
    @PostMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/condition")
    ${className}DTO getByCondition(@RequestBody ${className}DTO condition);

    /**
     * 获取所有列表
     *
     * @return
     **/
    @GetMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX)
    List<${className}DTO> listAll();

    /**
     * 根据条件获取列表
     *
     * @param condition
     * @return
     **/
    @GetMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/list/condition")
    List<${className}DTO> findByCondition(@RequestBody ${className}DTO condition);

    /**
     * 获取分页
     *
     * @param conditionAndPagination
     * @return
     **/
    @PostMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/page")
    PageData<${className}DTO> page(@RequestBody ConditionAndPagination<${className}DTO> conditionAndPagination);

    /**
     * 根据ID删除
     *
     * @param id
     * @return
     **/
    @DeleteMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/{id}")
    Boolean deleteById(@PathVariable("id") Long id);

    /**
     * 根据条件删除
     *
     * @param condition
     * @return
     **/
    @DeleteMapping(CommonServiceConstants.SERVLET_CONTEXT_PATH + ${className}ServiceConstants.DEFAULT_URL_PREFIX + "/condition")
    Boolean deleteByCondition(@RequestBody ${className}DTO condition);
}